package com.aaa.controller;

import com.aaa.entity.Admin;
import com.aaa.service.AdminService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("admin")
public class AdminController {
    @Resource
    AdminService adminService;
    @RequestMapping("login")
    @ResponseBody
    public Integer login(String name, String password){
        return adminService.login(name,password);
    }
    @RequestMapping("add")
    @ResponseBody
    public Integer add(Admin admin){
        return adminService.add(admin);
    }
}
